home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gekkan Dennou Club 147
/
Gekkan Dennou Club - 2000.8 Vol. 147 (Japan).7z
/
Gekkan Dennou Club - 2000.8 Vol. 147 (Japan) (Track 1).bin
/
games
/
addition
/
addition.bas
< prev
next >
Wrap
BASIC Source File
|
2000-07-08
|
7KB
|
353 lines
screen 0,2,1,1
window(0,0,511,511)
/*
sp_init()
sp_xinit()
sp_clr(0,255)
sp_disp(1)
sp_on(0,127)
spfile_def("addsp.SP", 0)
palfile_def("addsp.PAL", 1)
/*
/*
/*
str dummy
dim char k(4,11),spmap(4,11),sp(63)
char blk,next_blk,col,next_col
dim char se0(4687),se1(4687),se2(2092),se3(8295),se4(5931)
dim char go(15)= {&H26,&h20,&h2c,&h24,&h0f,&h2e,&h35,&h24,&h31}
dim char push(10)={&h2f,&h34,&h32,&h27,&h0f,&h32,&h33,&h20,&h31,&h33}
dim char bgm_op(1500),p_stop(12),bgm0(5361),bgm1(701)
char MODE
char COUNT=8
int spr,pcm_fp,fm_fp
int score=0
int x, y, ni
int block_pd,next_block_pd
int l,i,j,lp,fp
/*
/*
/*
fm_fp=fopen("OPM","w")
fp=fopen("adop.zmd","r")
fread(bgm_op,1500,fp)
fclose(fp)
fp=fopen("ps.zmd","r")
fread(p_stop,12,fp)
fclose(fp)
fp=fopen("ne1.zmd","r")
fread(bgm0,5361,fp)
fclose(fp)
fp=fopen("ec.zmd","r")
fread(bgm1,701,fp)
fclose(fp)
/*
pcm_fp=fopen("PCM","w")
fp=fopen("se0.pcm","r")
fread(se0,4687,fp)
fclose(fp)
fp=fopen("se1.pcm","r")
fread(se1,4687,fp)
fclose(fp)
fp=fopen("se2.pcm","r")
fread(se2,2092,fp)
fclose(fp)
fp=fopen("se3.pcm","r")
fread(se3,8295,fp)
fclose(fp)
fp=fopen("se4.pcm","r")
fread(se4,5931,fp)
fclose(fp)
/*
/*************************************************** メイン
/*
v_priority( "TSG", "10")
while 1
ar_init()
MODE = 1 - title()
if MODE = -1 then exit()
main()
endwhile
/*
/*************************************************** ゲーム用意
/*
func main()
x = 2
y = 0
ni = 0
spr = 0
/*
vpage(0) /* 画面真っ黒
apage(0)
apic_load("adbg0.PIC")
apage(1)
box(87,39,168,232,&h20)
box(86,38,169,233,&h20)
for l=64 to 82:sp_set(l, 0, 0, 0):next
for l=0 to 9
sp_set(69 + l, l * 16 + 66, 128, &h400 + push(l))
next
/*
sp_set(68, 63, 24, &h42d) /* NEXT
sp_set(67, 79, 24, &h424)
sp_set(66, 95, 24, &h437)
sp_set(65, 111, 24, &h433)
/*
blk = block()
col = b_col()
next_blk = block()
next_col = b_col()
/*
if MODE then next_col=col
block_pd = col * &h100 + blk
sp_set(0, 135, 24, block_pd)
for l=0 to 9 : sp_set(69 + l, l * 16 + 66, 128, &h400 + push(l)) : next
vpage(3) /* 画面開けます
while strig(1)=0 and asc(inkey$(0))<>&h20 : endwhile
for l=69 to 82:sp_set(l, 0, 0, 0):next
/*
sp_set(0, 135, 40, block_pd)
next_block_pd = next_col * &h100 + next_blk
sp_set(64, 135, 24, next_block_pd)
fwrite(se4,5931,pcm_fp)
fwrite(bgm0,5361,fm_fp)
wait(60)
/*
/*************************************************** ゲーム開始
/*
score=0
while 1
locate 21,1:print using "#####,@";score,"億点"
spr=0
iocs(3,0)
while 1
if sp(spr)=0 then break else spr=spr+1
endwhile
sp_set(spr, 135, 40, block_pd)
if k(2,0) then gameover():break
for y=0 to 11
for l=0 to 2
wait(COUNT)
lp = joy()
sp_set(spr, x * 16 + 103, y * 16 + 55, block_pd)
if lp then break
next
if y=11 then add(y):break
if k(x,y+1) then ni = add(y):break
if k(x,y)=0 then sp_set(spr, x * 16 + 103, y * 16 + 55, block_pd)
next
/*
blk = next_blk
col = next_col
next_blk = block()
next_col = b_col()
if MODE then next_col=col
if ni and MODE=0 then next_blk = 2 : ni = 0
block_pd = next_col * &h100 + next_blk
sp_set(64, 135, 24, block_pd)
block_pd = col * &h100 + blk
x = 2
endwhile
endfunc
end
/*
/*************************************************** 消えるかな?
/*
func add(y)
int ret
k(x,y)=blk
spmap(x,y)=spr
sp(spr)=col
if y>=10 then return(0)
if (k(x,y)+k(x,y+1))=k(x,y+2) then ret = block_clr():return(ret)
if abs(k(x,y)-k(x,y+1))=k(x,y+2) then ret = block_clr():return(ret)
return(0)
endfunc
/*
/*************************************************** 消します
/*
func block_clr()
int ret = 0
fwrite(se0,4687,pcm_fp)
for l=7 to 14
for j=0 to 2
sp_set(spmap(x,y+j), x * 16 +103, (y+j) * 16 + 55, &h510+l)
v_disp()
next
next
/*
if sp(spmap(x,y)) = sp(spmap(x,y+1)) then if sp(spmap(x,y+1)) = sp(spmap(x,y+2)) then ret = -1
score = score + k(x,y) + k(x,y+1) + k(x,y+2)
/*
for i=0 to 2
k(x,y+i)=0
sp_set(spmap(x,y+i), 0, 0, &h100)
sp(spmap(x,y+i))=0
spmap(x,y+i)=0
next
return(ret)
endfunc
/*
/*************************************************** キー入力
/*
func joy()
char stk
str kb
int ret=0
/*
stk = stick(1)
kb = inkey$(0)
if asc(kb) then iocs(3,0)
if asc(kb)=&h1b then exit()
/*
if stk = 0 then {
switch asc(kb)
case &h1e : stk = 8 : break
case &h38 : stk = 8 : break
case &h1c : stk = 6 : break
case &h36 : stk = 6 : break
case &h1d : stk = 4 : break
case &h34 : stk = 4 : break
case &h1f : stk = 2 : break
case &h32 : stk = 2 : break
endswitch
}
/*
switch stk
case 2:ret = +1
break
case 8:if y=11 then break
if k(x,y+1) then break
ret = -1
break
case 4:if x=0 then break
if k(x-1,y) then break
x=x-1
v_disp()
break
case 6:if x=4 then break
if k(x+1,y) then break
x=x+1
v_disp()
break
endswitch
return(ret)
endfunc
/*
/*************************************************** 数字決定
/*
func block()
int rt
rt = rand() mod 7 + 3
return(rt)
endfunc
/*
/*************************************************** カラー決定
/*
func b_col()
int rt
rt = rand() mod 3 + 1
return(rt)
endfunc
/*
/*************************************************** WAIT
/*
func wait(loop)
int i
for i=0 to loop
v_disp()
next
endfunc
/*
/*************************************************** ゲームオーバー
/*
func gameover()
cls
sp_set(spr, 0, 0, block_pd)
for i=0 to 14
for y=0 to 11
for x=0 to 4
if k(x,11-y) then {
sp_set(spmap(x,11-y), x * 16 +103, (11 - y) * 16 + 55, &h610 + i)
}
next
next
fwrite(se1,4687,pcm_fp)
wait(1)
next
/*
fwrite(bgm1,701,fm_fp)
for j=0 to 8
sp_set(64 + j, j * 16 + 72, 128, &h400 + go(j))
next
/*
wait(300)
endfunc
/*
/*************************************************** 初期化
/*
func ar_init()
int x,y,i
for x=0 to 4
for y=0 to 11
k(x,y)=0
spmap(x,y)=0
next
next
for i=0 to 63:sp(i)=0:next
endfunc
/*
/*************************************************** タイトル画面
/*
func title()
dim char nrm(6)={&h2d,&h2e,&h31,&h2c,&h20,&h2b}
dim char trp(6)={&h33,&h31,&h28,&h2f,&h2b,&h24}
dim char ext(6)={&h0f,&h24,&h37,&h28,&h33,&h0f}
int i,l,tg
vpage(0) /* 画面真っ黒
apage(0)
apic_load("title.pic")
apage(1)
wipe()
/*
for i=0 to 5
sp_set(64 + i, 96 + i * 16, 152, &h400 + nrm(i))
sp_set(70 + i, 96 + i * 16, 176, &h400 + trp(i))
sp_set(76 + i, 96 + i * 16, 200, &h400 + ext(i))
next
vpage(3) /* 画面開けます
/*
i = 0
y = 0
x = 2
/*
fwrite(bgm_op,1500,fm_fp)
while 1
sp_set( 82, 72, 152 + y * 24, &hb40)
tg = joy()
if tg = -1 and y>0 then y=y-1:wait(5):fwrite(se2, 2092, pcm_fp)
if tg = +1 and y<2 then y=y+1:wait(5):fwrite(se2, 2092, pcm_fp)
if strig(1) then break
if asc(inkey$(0))=&h20 then break
wait(3)
endwhile
/*
fwrite(p_stop,12,fm_fp)
fwrite(se3,8295,pcm_fp)
for l=0 to 47
i = (i + 1) and 3
wait(1)
sp_set( 82, 72, 152 + y * 24, &hb40 + i)
next
/*
sp_set( 82,,, &hb40)
if y=0 then for l=70 to 81:sp_set( l, 0, 0, 0):next
if y=1 then for l=64 to 69:sp_set( l, 0, 0, 0):sp_set( l + 12, 0, 0):next
if y=2 then for l=64 to 75:sp_set( l, 0, 0, 0):next
return(y)
endfunc
end